home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel
/
CAROUSEL.cdr
/
mactosh
/
hc
/
workstat.sit
/
WorkStation v3.8
/
stack.txt
< prev
Wrap
Text File
|
1988-02-26
|
19KB
|
552 lines
-- stack: in.8
-- format: 8 (HyperCard 1)
-- flags: 0x0 (none)
-- protect password hash: 0
-- maximum user level: 5 (scripting)
-- window: Rect(x1=0, y1=0, x2=0, y2=0)
-- screen: Rect(x1=0, y1=0, x2=0, y2=0)
-- card dimensions: w=0 h=0
-- scroll: x=0 y=0
-- background count: 2
-- first background id: 2783
-- card count: 9
-- first card id: 3051
-- list block id: 5738
-- print block id: 0
-- font table block id: 0
-- style table block id: 0
-- free block count: 2
-- free size: 6016 bytes
-- total size: 57344 bytes
-- stack block size: 18432 bytes
-- created by hypercard version: 0x00000000
-- compacted by hypercard version: 0x00000000
-- modified by hypercard version: 0x00000000
-- opened by hypercard version: 0x00000000
-- patterns[0]: 0x0000000000000000
-- patterns[1]: 0x8000000008000000
-- patterns[2]: 0x8800220088002200
-- patterns[3]: 0x8888222288882222
-- patterns[4]: 0x88AA22AA88AA22AA
-- patterns[5]: 0xCCAA33AACCAA33AA
-- patterns[6]: 0xEEAABBAAEEAABBAA
-- patterns[7]: 0xEEBBBBEEEEBBBBEE
-- patterns[8]: 0xFFBBFFEEFFBBFFEE
-- patterns[9]: 0xFFBBFFFFFFBBFFFF
-- patterns[10]: 0x8010022001084004
-- patterns[11]: 0xFFFFFFFFFFFFFFFF
-- patterns[12]: 0x8822882288228822
-- patterns[13]: 0x1122448811224488
-- patterns[14]: 0xC4800C6843023026
-- patterns[15]: 0xB130031BD8C00C8D
-- patterns[16]: 0xAA00AA00AA00AA00
-- patterns[17]: 0x8822552288225522
-- patterns[18]: 0x8855225588552255
-- patterns[19]: 0x77DD77DD77DD77DD
-- patterns[20]: 0x8000000000000000
-- patterns[21]: 0xAA55AA55AA55AA55
-- patterns[22]: 0x038448300C020101
-- patterns[23]: 0x8244394482010101
-- patterns[24]: 0x8814224188412214
-- patterns[25]: 0x8080413E080814E3
-- patterns[26]: 0x22048C7422179810
-- patterns[27]: 0xBE808808EB088880
-- patterns[28]: 0x25C8328964244C92
-- patterns[29]: 0xA29C41BE2AC914EB
-- patterns[30]: 0x40A00000040A0000
-- patterns[31]: 0x8040200002040800
-- patterns[32]: 0xAA00800088008000
-- patterns[33]: 0xFF80808080808080
-- patterns[34]: 0x081C22C180010204
-- patterns[35]: 0xFF808080FF080808
-- patterns[36]: 0xF87422478F172271
-- patterns[37]: 0xBF00BFBFB0B0B0B0
-- patterns[38]: 0xFF7FBE5DA2418000
-- patterns[39]: 0xFAF5FAF5A050A050
-- checksum: 0x0
----- HyperTalk script -----
on openStack
global levelHolder, holdNum, dialNumber
set the userLevel to 5
put long name of this stack into pathname
delete first word of pathname
set lockscreen to true
show bkgnd btn "Work Station©"
get script of bkgnd btn "Work Station©"
delete word 2 of line 2 of it
put ""&&pathname after word 1 of line 2 of it
set the script of bkgnd button "Work Station©" to it
hide bkgnd btn "Work Station©"
set lockscreen to false
hide menuBar
show bkgnd btn id 39
hide bkgnd btn id 40
end openStack
-----------------------------------------------------------------------
on openCard
put the date into field "date/time"
end openCard
-----------------------------------------------------------------------
on killButton
choose Button tool
click at the clickLoc
doMenu "Cut Button"
choose Browse tool
end killButton
-----------------------------------------------------------------------
on WSHelp
push card
visual dissolve to gray
go to card id 7152
hide menuBar
set the scroll of field "info text" to 0
set the scroll of card field id 2 to 0
end WSHelp
-----------------------------------------------------------------------
function clickLine
return (trunc(((scroll of the target) + (item two of the clickloc) - (item two of the rect of the target)) div the textHeight of the target) + one)
end ClickLine
-----------------------------------------------------------------------
on newWSCard
go to card "Main Card"
ask "Enter name of new Work Station card…" with " (maximum of 22 characters)"
if it is " (maximum of 22 characters)" or it is empty then
exit newWSCard
else
put it into cardName
find cardName in field "card name"
if the result is empty then
beep
answer "Card title"&"e& cardName "e&" is already in use!"
exit newWSCard
else
if the length of cardName > 22 then
beep
answer "Only 22 characters are allowed! Try again..." with "OK"
exit newWSCard
end if
end if
push card
set cursor to 4
set lockScreen to true
doMenu "New Card"
put cardName into bkgnd field id 23
set the name of this card to cardName
pop card
get the number of items of card field id 8
add 1 to it
put cardName &"," into item it of card field id 8
set lockScreen to false
visual dissolve to black
go to card cardName
play harpsichord "g c"
end if
end newWSCard
-----------------------------------------------------------------------
on deleteWSCard
ask "Enter name of card to be deleted…" with " Enter name exactly as in card title field!"
if it is " Enter name exactly as in card title field!" or it is empty then
exit deleteWSCard
else
put it into cardName
find cardName in bkgnd field "card name"
if the result is not empty then
beep
answer "Card"&"e& cardName "e&" not found in stack!"
exit deleteWSCard
else
visual dissolve to black
go to card cardName
play Boing "gq"
answer "Delete this card…"&"e& cardName "e& "?" with "OK" or "Cancel"
if it is "OK" then
set lockScreen to true
set cursor to 4
doMenu "Delete Card"
doMenu "Compact Stack"
go to card id 3051
put cardName&"," into text
put offset (text,card field id 8) into start
put the length of text into count
put start + count into total
repeat until total = start
delete char start of card field id 8
subtract 1 from total
end repeat
set lockScreen to false
end if
end if
end if
play harpsichord "gq cq"
choose Browse tool
end deleteWSCard
-----------------------------------------------------------------------
on newPhoneName
play harpsichord "cq"
ask "Enter the new name and phone number…" with " Ann E. Macintosh, 1-214-555-1212"
if it is " Ann E. Macintosh, 1-214-555-1212" or it is empty then
pop card
exit newPhoneName
else
set cursor to 4
set lockScreen to true
put it into phoneName
put last item of phoneName into holder
put " "&holder into last item of phoneName
get the number of lines of card field id 1
add 1 to it
put phoneName into line it of card field id 1
put last word of item 1 of line it of card field id 1 into temp
delete last word of item 1 of line it of card field id 1
put temp&", " before first word of item 1 of line it of card field id 1
if last char of item 2 of line it of card field id 1 is " " then
put empty into last char of item 2 of line it of card field id 1
end if
put sort( card field "Phone Directory", "a" ) into card field id 1
set the scroll of card field id 1 to 0
set lockText of card field id 1 to true
hide card button id 4
show card button id 3
play harpsichord "gq"
set lockScreen to false
end if
end newPhoneName
-----------------------------------------------------------------------
on DAlaunch
set cursor to 4
getDANames --ΓÇóΓÇóthanks Aron Roberts!ΓÇóΓÇó
play harpsichord "gq"
DoList "Select DA","Forget it!",namesOfDAs,one --ΓÇóΓÇóthanks J.L.Paul!ΓÇóΓÇó
if the result > 0 then
put item 2 of the result into daName
else
exit DAlaunch
end if
set cursor to 4
set lockScreen to true
doMenu "New Button"
hide btn "New Button"
put daName into btnName
set rect of btn "New Button" to 128,312,211,326
set textStyle of btn "New Button" to plain
set textSize of btn "New Button" to 9
set textFont of btn "New Button" to Geneva
set textAlign of btn "New Button" to center
set showName of btn "New Button" to true
set the style of btn "New Button" to transparent
set the autoHilite of button "New Button" to true
put "on mouseUp" & return into line 1 of newScript
put "doMenu" &"e&daName"e& return after newScript
put "show menuBar" & return after newScript
put "show bkgnd btn id 40" & return after newScript
put "end mouseUp" & return after newScript
set name of btn "New Button" to btnName
set script of btn btnName to newScript
show btn btnName
doMenu "Cut Button"
doMenu "Background"
doMenu "Paste Button"
doMenu "Background"
click at 150,315
set lockScreen to false
set the loc of msg to 20,204
put "Drag the new button to appropriate location and press Command-Tab" into message
show Message
repeat 3
set the hilite of bkgnd btn btnName to true
wait 20 ticks
set the hilite of bkgnd btn btnName to false
wait 20 ticks
end repeat
end DAlaunch
-----------------------------------------------------------------------
on newQuikButton
ask "Enter the name of the new Quik Button…" with " (maximum of 9 characters)"
if it is " (maximum of 9 characters)" or it is empty then
exit newQuikButton
else
put it into newName
if the length of newName > 9 then
beep
answer "Only 9 characters are allowed! Try again…" with "OK"
exit newQuikButton
end if
ask "Enter the name of the 'Work Station' card…" with " …as it appears in the card's title field!"
if it is " …as it appears in the card's title field!" or it is empty then
exit newQuikButton
else
put it into buttonName
find buttonName in field "card name"
if the result is not empty then
beep
answer "Can't find card"&"e& buttonName "e&" in stack!"
exit newQuikButton
else
set cursor to 4
push card
set lockScreen to true
go to card buttonName
get the id of this card
put it into Saver
pop card
doMenu "New Button"
set rect of btn "New Button" to 148,312,190,326
set textStyle of btn "New Button" to plain
set textSize of btn "New Button" to 9
set textFont of btn "New Button" to Geneva
set textAlign of btn "New Button" to center
set showName of btn "New Button" to true
set the style of btn "New Button" to transparent
put "on mouseUp" into line 1 of newScript
put "visual zoom open" into line 2 of newScript
put "go to "& Saver & "" into line 3 of newScript
put "end mouseUp" into line 4 of newScript
set the autoHilite of btn "New Button" to true
set the script of btn "New Button" to newScript
set name of btn "New Button" to newName
doMenu "Cut Button"
doMenu "Background"
doMenu "paste Button"
doMenu "Background"
click at 150,315
set the loc of message to 20,204
put "Drag the new button to appropriate location and press Command-Tab" into message
show msg
set lockScreen to False
repeat 3
set the hilite of bkgnd btn newName to true
wait 20 ticks
set the hilite of bkgnd btn newName to false
wait 20 ticks
end repeat
end if
end if
end if
end newQuikButton
-----------------------------------------------------------------------
-- Script for ΓÇ£Add ApplicationΓÇ¥ button
-- by Dennis C. DeMars, modified by Debbie Iwatate
-- Note: This script uses the following XFCNs
-- Filename written by Steve Maller
-- GetAppIcon written by Dennis C. DeMars
--.....................................................................
function buttonName fullName
put the length of fullName into lastChar
repeat with i = lastChar down to 1
if char i of fullName = ":" then exit repeat
end repeat
return char (i + 1) to lastChar of fullName
end buttonName
-----------------------------------------------------------------------
on appInstall
put fileName("APPL") into appFile
if appFile = empty
then exit appInstall
set cursor to 4
put buttonName(appFile) into appName
put long name of this stack into destFile
put char 8 to (number of chars in destFile - 1) of destFile into destFile
put GetAppIcon(appFile,appName,destFile) into iconNo
UpdateResFork
if iconNo = "0" then exit appInstall
set lockScreen to true
doMenu "New Button"
set name of last btn to appName
put the id of btn appName into butIDtemp
put the long name of this stack into stackName
delete first word of stackName
set style of btn appName to transparent
set showName of btn appName to true
set autoHilite of btn appName to true
set icon of btn appName to iconNo
set rect of btn appName to 161,142,244,199
put "on mouseUp" & return into buttonScript
put "if the commandKey is down then" & return after buttonScript
put "do ""e&"killButton""e&& return after buttonScript
put "KillResID "&stackName&",""e&"ICON""e&","&iconNo&& return after buttonScript
put "else" & return after buttonScript
put "global longname" & return after buttonScript
put "put " & quote & appFIle & quote & " into longname" & return after buttonScript
put "LaunchAPP" & return after buttonScript
put "end if" & return after buttonScript
put "end mouseUp" & return after buttonScript
set script of btn appName to buttonScript
set lockScreen to false
repeat 3
set the hilite of card btn appName to true
wait 20 ticks
set the hilite of card btn appName to false
wait 20 ticks
end repeat
end appInstall
-----------------------------------------------------------------------
on launchApp
set cursor to 4
global longname
set hilite of target to false
if multifinder() is true then
if isRunning(short name of the target) is true then
beep
answer "This application is already running!"
else
put sublaunch (longname) into launchResult
if launchResult <0 then osErr launchResult
else if launchresult >0 then
beep
answer "Can't launch application, check RAM!"
end if
end if
else
open longname
end if
end launchApp
------------------------------------------------------------------------
-- Script for ΓÇ£Add DocumentΓÇ¥ button
-- by Dennis C. DeMars, modified by Debbie Iwatate
-- Note: This script uses the following XFCNs
-- Filename written by Steve Maller
-- GetDocIcon written by Dennis C. DeMars
--.....................................................................
on docInstall
put fileName("APPL") into appFile
if appFile = empty then exit docInstall
put fileName() into docFile
if docFile = empty then exit docInstall
set cursor to 4
put buttonName(docFile) into docName
put long name of this stack into destFile
put char 8 to (number of chars in destFile - 1) of destFile into destFile
put GetDocIcon(appFile,docFile,destFile) into iconNo
UpdateResFork
if iconNo = "0" then exit docInstall
set lockScreen to true
choose button tool
doMenu "New Button"
set name of last btn to docName
set style of btn docName to transparent
set showName of btn docName to true
set icon of btn docName to iconNo
set autoHilite of btn docName to true
set rect of btn docName to 150,150,233,207
put "on mouseUp" & return into buttonScript
--Modified buttonscript so that LaunchDoc may be used.
put "global longname" & return after buttonScript
put "put " & quote & docFIle & "," & appfile & quote & " into longname" & return after buttonScript
put "LaunchDoc" & return after buttonScript
put "end mouseUp" & return after buttonScript
set script of button docName to buttonScript
set lockScreen to false
repeat 3
set the hilite of card btn docName to true
wait 20 ticks
set the hilite of card btn docName to false
wait 20 ticks
end repeat
end docInstall
-----------------------------------------------------------------------
on LaunchDoc
set cursor to 4
global LongName
set hilite of target to false
put Convertname(longName) into appName
put second item of longName into appPath
put first item of longName into docPath
if multifinder() is true then
if isRunning(appName) is true then
beep
answer "Please switch to the application to open this"
else
put sublaunch(appPath,docPath) into LaunchResult
if launchResult <0 then osErr launchResult
else if launchresult >0 then beep
end if
else
open docPath with appPath
end if
end LaunchDoc
-----------------------------------------------------------------------
on stackInstall
doMenu "New Button"
ask "Enter the name of the new Stack Button…" with "Stack Button Name"
if it is "Stack Button Name" or it is empty then
doMenu "Cut Button"
choose Browse tool
exit stackInstall
else
put it into btnName
set name of last btn to btnName
set rect of btn btnName to 150,150,233,207
set style of btn btnName to transparent
set textFont of btn btnName to Geneva
set textSize of btn btnName to 9
set textStyle of btn btnName to plain
set showName of btn btnName to true
set autoHilite of btn btnName to true
set the loc of message to 20,294
put "Click on 'Icon…' and select an icon for your new stack button…"
show msg
click at 170,170
play harpsichord "gq"
doMenu "Button Info..."
put "Click on 'Link to…', enter 'COMMAND-O', and select the linked stack…"
show msg
play harpsichord "cq"
doMenu "Button Info..."
end if
repeat 3
set the hilite of card btn btnName to true
wait 20 ticks
set the hilite of card btn btnName to false
wait 20 ticks
end repeat
hide msg
end stackInstall
-----------------------------------------------------------------------
on WSbuttonMaker
global levelHolder
---
play "Boing" gh
answer "Paste Work Station© button into Home stack?" with "Go ahead!" or "Cancel"
if it is "Go ahead!" then
put the userLevel into levelHolder
show bkgnd field "Pasting Field"
show bkgnd btn "Work Station©"
set lockScreen to true
set cursor to 4
get the loc of bkgnd button "Work Station©"
choose Button tool
click at it
doMenu "Copy Button"
push card
go home
set the userLevel to 5
doMenu "Paste Button"
set rect of button "Work Station©" to 217,243,300,300
pop card
choose Browse tool
set lockScreen to false
play "Boing" gh
hide bkgnd field "Pasting Field"
hide bkgnd btn "Work Station©"
set the userLevel to levelHolder
end if
end WSbuttonMaker
-----------------------------------------------------------------------
function ConvertName LongName
set cursor to 4
put the length of LongName into nameLength
repeat with x = nameLength down to 1
if char x of LongName = ":" then exit repeat
end repeat
return char (x + 1) to nameLength of LongName
end ConvertName
-----------------------------------------------------------------------
on idle
put the short time into line 2 of bkgnd field "date/time"
pass idle
end idle